﻿using Abp.Domain.Entities;
using Batman.Jianbei.Forum.Core.Domains.Dicts;
using Batman.Jianbei.Forum.Core.Domains.Users;
using Batman.Jianbei.Forum.Core.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Batman.Jianbei.Forum.Core.Domains.Posts
{
    /// <summary>
    /// 帖子
    /// </summary>
    public class Post : Entity<string>
    {
        [MaxLength(120)]
        public string Title { get; set; }

        [MaxLength(2000)]
        public string PostContent { get; set; }

        /// <summary>
        /// 话题
        /// </summary>
        [Required]
        public string TopicId { get; set; }

        public Topic Topic { get; set; }

        /// <summary>
        /// 作者ID
        /// </summary>
        public string WxUserId { get; set; }

        /// <summary>
        /// 作者
        /// </summary>
        public WeixinUser WxUser { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime CreateAt { get; set; }

        /// <summary>
        /// 帖子状态
        /// </summary>
        public PostStatus Status { get; set; }

        /// <summary>
        /// 图片
        /// </summary>
        public List<PostImg> Imgs { get; set; }
    }
}
